package com.stone.compose

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import com.stone.compose.ui.screen.SplashScreen
import com.stone.compose.ui.screen.home.HomeScreen
import com.stone.compose.ui.screen.message.MessageScreen
import com.stone.compose.ui.theme.DemocomposeTheme

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            DemocomposeTheme {
                Surface(
                    modifier = Modifier.fillMaxSize(),
                    color = MaterialTheme.colorScheme.background
                ) {
//                    MainScreen()
                    MessageScreen()
                }
            }
        }
    }
}

@Composable
fun MainScreen(){

    var isSplash by remember { mutableStateOf(true) }

    if(isSplash){
        SplashScreen{
            isSplash = false
        }
    }else{
        HomeScreen()
    }



}
